home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 018a / apcrssrf.zip / CROSSREF.SMM < prev    next >
INI File  |  1991-11-07  |  5KB  |  307 lines

  1. [ver]
  2.     4
  3. [sty]
  4.     ~macro.sty
  5. [files]
  6. [charset]
  7.     82
  8.     ANSI (Windows, IBM CP 1252)
  9. [revisions]
  10.     0
  11. [prn]
  12.     PostScript Printer
  13. [lang]
  14.     1
  15. [desc]
  16.     Generate cross references between files in a master document that has less than 8 files.
  17.     Lotus Word Processing Division
  18.     Advanced
  19.     FileOpen, MasterDocument
  20.     
  21.     689536675
  22.     17
  23.     672617318
  24.     46
  25.     1
  26.     0
  27.     0
  28.     0
  29.     0
  30.     
  31.     
  32.     
  33.     
  34.     
  35.     
  36.     0
  37. [fopts]
  38.     0
  39.     1
  40.     0
  41.     0
  42. [lnopts]
  43.     2
  44.     Body Text
  45.     1
  46. [docopts]
  47.     5
  48.     2
  49. [l1]
  50.     0
  51. [pg]
  52.     1
  53.     64 0 0 1025 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0
  54. [edoc]
  55. <:#202,10080>' Xref - cross reference between files in a master document.
  56.  
  57. <:#202,10080>' Because the field "Pageref" can only work with bookmarks in 
  58.  
  59. <:#202,10080>' the current file, when the user needs the page number of 
  60.  
  61. <:#202,10080>' a bookmark in another file, he can just insert the bookmark
  62.  
  63. <:#202,10080>' name where he wants the number.
  64.  
  65. <:#202,10080>' This macro will run through all files in the master, and for
  66.  
  67. <:#202,10080>' each bookmark it will determine the actual page number, then
  68.  
  69. <:#202,10080>' create a global variable by that same name, and assign the 
  70.  
  71. <:#202,10080>' page number to it.  Finally it will go through each file agian
  72.  
  73. <:#202,10080>' updating all fields to satisfy those fields.  The field manager
  74.  
  75. <:#202,10080>' will now find a global varibale to satisfy those bookmark 
  76.  
  77. <:#202,10080>' references.
  78.  
  79. <:#202,10080>' This version is limited to 9 files, as we keep them all loaded
  80.  
  81. <:#202,10080>' between the two passes
  82.  
  83. <:#202,10080>'
  84.  
  85. <:#202,10080>FUNCTION Xref()
  86.  
  87. <:#202,10080>defstr mascount;
  88.  
  89. <:#202,10080>if (0 = Assign(&mascount, GetMasterFilesCount()))
  90.  
  91. <:#202,10080>    message("Not a master document")
  92.  
  93. <:#202,10080>    return -1;
  94.  
  95. <:#202,10080>endif
  96.  
  97. <:#202,10080>dim    masfiles(mascount)
  98.  
  99. <:#202,10080>GetMasterFiles(&masfiles)
  100.  
  101. <:#202,10080>Declare    CreateGlobals();
  102.  
  103. <:#202,10080>Generate(0)
  104.  
  105. <:#202,10080>for i = 1 to mascount - 1    ' Generate left the last one up
  106.  
  107.     FileOpen(masfiles(i), 1, "AmiPro")
  108.  
  109. <:#202,10080>    DarkMode(1)
  110.  
  111. <:#202,10080>    type("<[>ctrlend]")    ' Force load to finish
  112.  
  113. <:#202,10080>    type("<[>ctrlhome]")    ' Back to the top for looks
  114.  
  115. <:#202,10080>    DarkMode(0)
  116.  
  117. <:#202,10080>    CreateGlobals()
  118.  
  119. <:#202,10080>next
  120.  
  121. <:#202,10080>totalpage = PhysicalToLogical(EvalField("NumPages"));
  122.  
  123. <:#202,10080>tp = "totalpages"
  124.  
  125. <:#202,10080>AllocGlobalVar(tp, 1)
  126.  
  127. <:#202,10080>SetGlobalVar(tp, totalpage)
  128.  
  129. <:#202,10080>for i = 1 to mascount
  130.  
  131. <:#202,10080>    SelectWindow(masfiles(i))
  132.  
  133. <:#202,10080>    FieldUpdateAll()
  134.  
  135. <:#202,10080>    type("<[>ctrlend]")
  136.  
  137. <:#202,10080>    type("<[>ctrlhome]")
  138.  
  139. <:#202,10080>    Save()
  140.  
  141. <:#202,10080>next
  142.  
  143. <:#202,10080>END FUNCTION
  144.  
  145. <:#202,10080>FUNCTION CreateGlobals()
  146.  
  147. <:#202,10080>defstr bookcnt
  148.  
  149. <:#202,10080>if (0 = Assign(&bookcnt, GetBookMarkCount()))
  150.  
  151. <:#202,10080>    return 0;    ' No bookmarks, fast exit here
  152.  
  153. <:#202,10080>endif
  154.  
  155. <:#202,10080>dim booknames(bookcnt)
  156.  
  157. <:#202,10080>GetBookMarkNames(&booknames)
  158.  
  159. <:#202,10080>for i = 1 to bookcnt
  160.  
  161. <:#202,10080>    ' get the GetBookMarkPage returns the page number of the
  162.  
  163. <:#202,10080>    ' bookmark relative to this file, use PhysicalToLogical
  164.  
  165. <:#202,10080>    ' to the the logical page.  Then create a global var
  166.  
  167. <:#202,10080>    ' using the bookmark name, then assign that page number.
  168.  
  169. <:#202,10080>
  170.  
  171. <:#202,10080>    page = PhysicalToLogical(GetBookMarkPage(booknames(i)))
  172.  
  173. <:#202,10080>    AllocGlobalVar(booknames(i), 1)
  174.  
  175. <:#202,10080>    SetGlobalVar(booknames(i), page)
  176.  
  177. <:#202,10080>next
  178.  
  179. <:#202,10080>END FUNCTION
  180.  
  181. <:#202,10080>
  182.  
  183. >
  184.  
  185. [Embedded]
  186. 00003658
  187. >
  188. [macsum] 2
  189. Xref 0 0 6 15
  190. CreateGlobals 629 0 5 45
  191. [macse]
  192. 14 Xref
  193. 5 0
  194. 0 1047
  195. 13
  196. 0 805 &1 [X]
  197. 13
  198. 18 0
  199. 11 00000105
  200. 0 3 "Not a master document"
  201. 5 -1
  202. 15
  203. 9
  204. 6 1
  205. 21 2 [X]
  206. 0 1048 &2
  207. 2 465 1 0
  208. 5 1
  209. 8 3
  210. 6 1
  211. 5 1
  212. 3 1
  213. 6 3
  214. 18 2
  215. 12 00000237
  216. 10 00000351
  217. 5 1
  218. 6 3
  219. 3 0
  220. 8 3
  221. 10 00000152
  222. 6 3
  223. 22 2
  224. 2 102 1 [X] 1 "AmiPro"
  225. 0 292 1
  226. 0 6 "[16419]"
  227. 0 6 "[16420]"
  228. 0 292 0
  229. 16 CreateGlobals
  230. 10 00000204
  231. 0 1289 "NumPages"
  232. 13
  233. 0 791 [X]
  234. 13
  235. 8 4
  236. 7 "totalpages"
  237. 8 5
  238. 0 271 "{5}" 1
  239. 0 264 "{5}" "{4}"
  240. 5 1
  241. 8 3
  242. 6 1
  243. 6 3
  244. 18 2
  245. 12 00000534
  246. 10 00000617
  247. 5 1
  248. 6 3
  249. 3 0
  250. 8 3
  251. 10 00000459
  252. 6 3
  253. 22 2
  254. 0 796 [X]
  255. 2 267 1
  256. 0 6 "[16419]"
  257. 0 6 "[16420]"
  258. 2 103 1
  259. 10 00000501
  260. 6 0
  261. 15
  262. 9
  263. 14 CreateGlobals
  264. 5 0
  265. 0 1039
  266. 13
  267. 0 805 &1 [X]
  268. 13
  269. 18 0
  270. 11 00000084
  271. 5 0
  272. 15
  273. 9
  274. 6 1
  275. 21 2 [X]
  276. 0 1040 &2
  277. 5 1
  278. 8 3
  279. 6 1
  280. 6 3
  281. 18 2
  282. 12 00000195
  283. 10 00000307
  284. 5 1
  285. 6 3
  286. 3 0
  287. 8 3
  288. 10 00000120
  289. 6 3
  290. 22 2
  291. 0 1049 [X]
  292. 13
  293. 0 791 [X]
  294. 13
  295. 8 4
  296. 6 3
  297. 22 2
  298. 0 271 [X] 1
  299. 6 3
  300. 22 2
  301. 0 264 [X] "{4}"
  302. 10 00000162
  303. 6 0
  304. 15
  305. 9
  306. 00003683
  307.